const express = require("express");
const router = express.Router();

const {
  getFeedbackList,
  updateFeedbackAnswer,
} = require("../../router_handler/admin/feedback");

router.get("/getAll/:page/:limit/:type", async (req, res) => {
  const { page, limit, type } = req.params;
  const offset = (page - 1) * limit;
  res.send(await getFeedbackList(limit, offset, type));
});
router.put("/updateAnswer", async (req, res) => {
  const { id, answer } = req.body;

  res.send(await updateFeedbackAnswer(id, answer));
});
module.exports = router;
